package com.entor.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.entor.dao.BaseDaoI;
@Service
public class BaseService<T> {
	
	@Autowired
	private BaseDaoI<T> bdi;
	
	public List<T> find(T t){
		return bdi.find(t);
	}
	public T get(T t){
		List<T> list = this.find(t);
		return list.size()>0?list.get(0):null;
	}
	public int add(T t){
		int i = bdi.add(t);
		return i;
	}
	public int edit(T t){
		int i = bdi.edit(t);
		return i;
	}
	public int remove(T t){
		return 0;
	}
}
